package a.oschina.observedemo.demo4;

import java.util.ArrayList;

/**
 * 帮忙监听的女同学
 *
 * @author Administrator
 * @version [版本号, 2018/10/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class GrilObserver {
  private String action;
  private ArrayList<NbaMatcher> mNbaMatchers=new ArrayList<>();
  public void attach(NbaMatcher nbaMatcher){
      mNbaMatchers.add(nbaMatcher);
  }
  public void deAttach(){
      mNbaMatchers.remove(mNbaMatchers);
  }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }
    public void notifyObserver(){
        for (NbaMatcher nbaMatcher : mNbaMatchers) {
            nbaMatcher.update();
        }
    }
}
